package com.xdcplus.web.common.enums;

import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public enum OqcFreezeStatusEnum {
    // 数据操作错误定义
    NO(0, "未处理"),
    FREEZE(1, "冻结"),
    UNFREEZE(2, "解冻"),

    ;
    public static List<OqcFreezeStatusEnum> sortByValue() {
        return Stream.of(values())
                .sorted(Comparator.comparing(OqcFreezeStatusEnum::getCode))
                .collect(Collectors.toList());
    }
    private Integer code;

    private String msg;

    public static String getMsg(String code) {
        for (OqcFreezeStatusEnum ele : values()) {
            if(ele.getCode().equals(code)) {return ele.getMsg();}
        }
        return null;
    }

    OqcFreezeStatusEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
